Repository navigation
fix(dispatch-gates): a package-root vitest config or manifest edit derives check-console-intercept-disarm - #29556
Merged
Conversation
…rives check-console-intercept-disarm The gate declares what its scan opens (a package-root package.json and vitest config under each workspace glob) as ROOT_DIR_WATCH_HINTS in its own source, and its scan reds when that declaration drifts from pnpm-workspace.yaml. Both invocations leave the root-walk residue, so their two ROOT_WALK_RESIDUE_LEDGER rows are retired. The dispatch-gates self-test pins the acceptance against the live tree: every package-root config and manifest places both invocations; no test file under a package does. Claude-Session: https://claude.ai/code/session_01JQwxbXV6v4rbiDvvaaabhb Co-authored-by: Claude <noreply@anthropic.com>
…l array check:watch-hint-literal refuses a declaration wrapped in Object.freeze. Claude-Session: https://claude.ai/code/session_01JQwxbXV6v4rbiDvvaaabhb Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:devx#1 · os-warren · session_01JQwxbaBjisxkQo9hht9bFB 维护者速读
席位核对ACCEPT ·
|
Contributor
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #29353
Clause-②: no
Metadata-protocol: none
维护者速读
check-console-intercept-disarm在自己源码里声明它真正读的文件(各工作区包根的package.json与vitest.config.*),dispatch-gates据此把它派给改这些文件的卡;残差台账里它的两行随之删除。scripts/check-console-intercept-disarm.mjs(新声明与漂移检查)、scripts/pm/dispatch-gates.self-test.mjs(新增的实树钉子)、scripts/pm/dispatch-gates.data.mjs(删掉的两行)。node scripts/pm/dispatch-gates.mjs --commands --paths packages/services/service-sms/vitest.config.ts,预期输出里出现这道门的两条命令(主扫描与--self-test)。What changes
dispatch-gates.data.mjs. The order expected the data table; measured, the derivation reads a gate's population only from the gate's own source (theROOT_DIR_WATCH_HINTSidiom), anddispatch-gates.data.mjs's header says it is "not a watch surface". So the producer-side fix is a declaration inscripts/check-console-intercept-disarm.mjs:ROOT_DIR_WATCH_HINTS: one pair per workspace glob the gate parses,DIR/*/package.jsonandDIR/*/vitest.config.*. A glob in a non-final segment makes the derivation judge the hint as a pattern, one path segment per star, so a test file or a config below the package root is not covered.main()exits 1 when the declaration and the parsedpnpm-workspace.yamlglobs disagree in either direction (watchHintDrift), and the gate's self-test holds the real tree to it plus both drift directions on fixtures. A literal array, ascheck:watch-hint-literalrequires.workspaceGlobs()is split out ofworkspacePackageDirs()with no change in behaviour; the three gates that importworkspacePackageDirsare untouched.scripts/pm/dispatch-gates.data.mjs: the twoROOT_WALK_RESIDUE_LEDGERrows for the gate and its--self-testare retired, since both families have left the population. A note records why, beside the two earlier departures.scripts/pm/dispatch-gates.self-test.mjs: the card's acceptance, pinned against the live tree. Every package-root vitest config (80) and the manifest beside it places both invocations. A new package's config and manifest do too. No tracked test file under a package (6926) places either, and neither does a brand-new test file or a config below a package root.Why
The rows stated the population correctly and drew the wrong conclusion: an EDITED package-root config moves the gate as surely as a new package does. Because the rows only exempted the gate from the whole-tree channel, no path derived it at all.
Tests
399df5bb(tree only, then restored from HEAD;git diff HEADempty, blob hash matched): 80 of 80 package-root configs place neither invocation, and the test-file probe readsundetermined. With the fix, 0 of 80 are missed, and test files readsilent.node scripts/check-console-intercept-disarm.mjs --self-test:self-test OK: 15 cases + real-tree population floor + watch-hint declaration.Scan:OK: 80 vitest-running package(s).Verification
Final union on head
1b3ea66a(base399df5bb):node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 32 commands from the 3 changed paths; all 32 exit 0.--ranreconciliation: "32 derived famil(ies) accounted for — 32 run, 0 NOT-MEASURED".check:pm-dispatch-gates: "1945 cases pass" (fast tier). The first pass ona39185bawas 31 of 32:check:watch-hint-literalrefused theObject.freezewrapper, fixed in1b3ea66a.32 commands and exit codes on 1b3ea66
Acceptance notes
pnpm-workspace.yamland the rootvitest.preset.mtsalso move this gate, but neither carries a separator, so no spelling of either is a hint the derivation admits. Edits to those two files still learn of the gate from CI.packages:list, so the fouruimembers below it are outside its population. Measured: 40uiworkspace packages run vitest and none sets the disarm. The declaration follows what the gate reads today, and its drift check will ask for theuipairs on the day the parse reads them.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI-owned run)main, one pull request.scripts/**only,skip-changeset)packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbXV6v4rbiDvvaaabhb
Generated by Claude Code